<template>
  <div class="test-container" id="test">字体</div>
</template>

<script>
export default {
  mounted() {
    setTimeout(() => {
      console.log(test.style.getPropertyValue("font-size"));
    },2000);
  },
};
</script>

<style scoped lang="scss">
@function rpx($n) {
  @return calc(#{#{var(--width)} * $n / 1920});
}

@function vh($n) {
  @return calc(#{#{var(--height)} * $n / 1080});
}
.test-container {
  box-sizing: border-box;
  width: rpx(1920);
  height: vh(1080);
//   font-size: rpx(12);
  font-size: 12px;
  border: 1px solid red;
}
</style>